using System;
using System.Collections.Generic;
using System.Linq;

namespace CodeDom
{
  public interface IItem
  {
    /// <summary>
    /// Gets the id of the parent item.
    /// </summary>
    /// <value>The parent id.</value>
    Guid ParentId { get; }

    /// <summary>
    /// Gets the parent item, or null
    /// </summary>
    /// <value>The parent.</value>
    Item Parent { get; }

    /// <summary>
    /// Gets the unique ID of the item
    /// </summary>
    /// <value>The ID.</value>
    Guid ID { get; }

    /// <summary>
    /// Gets the name of the item
    /// </summary>
    /// <value>The name.</value>
    String Name { get; }

    /// <summary>
    /// Returns the child items of the item
    /// </summary>
    /// <value>The children.</value>
    IEnumerable<Item> Children { get; }

    /// <summary>
    /// Gets the template ID.
    /// </summary>
    /// <value>The template ID.</value>
    Guid TemplateID { get; }

    /// <summary>
    /// Gets the full item path.
    /// </summary>
    /// <value>The path.</value>
    string Path { get; }

    /// <summary>
    /// Gets the template for the item
    /// </summary>
    /// <value>The template.</value>
    Template Template { get; }

    /// <summary>
    /// Gets the fields on the item
    /// </summary>
    /// <value>The fields.</value>
    IEnumerable<Field> Fields { get; }

    /// <summary>
    /// Gets the value of a field by its ID
    /// </summary>
    /// <param name="id">The id.</param>
    /// <returns></returns>
    Field GetField(Guid id);

    /// <summary>
    /// Gets the value of a named field
    /// </summary>
    /// <param name="fieldName">Name of the field.</param>
    /// <returns></returns>
    Field GetField(string fieldName);
  }
}